<template>
  <div>
    <div class="footer_wrap">
      <router-link to="/laijiang">发现音乐</router-link>
      <router-link to="/laizhu?name=赖酱&age=29">我的音乐</router-link>
      <router-link to="/huwenshuai/胡文帅/18">朋友</router-link>
      <!-- <span @click="goto('/laijiang', 'Find')">发现音乐</span>
      <span @click="toPartQuery('/LaiZhu?name=赖酱&age=29', 'LaiZhu')"
        >我的音乐</span
      >
      <span @click="toParQuery('/huwenshuai/胡文帅/18', 'XiaoHu')">朋友</span> -->
    </div>
    <div class="top">
      <router-view></router-view>
    </div>
  </div>
</template>

<script>
export default {
  name: "StudyVueApp",

  data() {
    return {};
  },

  methods: {
    // $router:路由导航对象,用于切换路由
    goto(path, name) {
      this.$router.push({
        // path
        name,
      });
    },
    toPartQuery() {
      this.$router.push({
        name: "XiaoHu",
        // path: "/part",
        params: {
          username: "胡文帅吃粑粑",
          age: 99,
        },
      });
    },
    toParQuery() {
      this.$router.push({
        name: "LaiZhu",
        query: {
          name: "赖酱拉粑粑",
          age: 99,
        },
      });
    },
  },
};
</script>

<style scoped>
.footer_wrap {
  position: fixed;
  left: 0;
  top: 0;
  display: flex;
  width: 100%;
  text-align: center;
  background-color: #333;
  color: #ccc;
}
.footer_wrap a,
span {
  flex: 1;
  text-decoration: none;
  padding: 20px 0;
  line-height: 20px;
  background-color: #333;
  color: #ccc;
  border: 1px solid black;
}
.footer_wrap a:hover,
span {
  background-color: #555;
}
.top {
  padding-top: 62px;
}
.footer_wrap .router-link-active {
  color: white;
  background: black;
}
</style>